﻿using System;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace JustMVCTest.Models
{
    public class Papi_Users
    {
        [Required]
        [DisplayName("Username")]
        [Key, Column(Order = 0)]
        [StringLength(20, ErrorMessage = "Length must be under 20 chars")]
        public string domain_username { get; set; }
        [Required]
        [DisplayName("Email")]
        [StringLength(75)]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$", ErrorMessage = "Enter a valid Email address")]
        public string email { get; set; }
        [Required]
        [DisplayName("First Name")]
        [StringLength(20, ErrorMessage = "Length must be under 20 chars")]
        public string First_Name { get; set; }
        [Required]
        [DisplayName("Last Name")]
        [StringLength(20, ErrorMessage = "Length must be under 20 chars")]
        public string Last_Name { get; set; }
        [Required]
        [DisplayName("Requisitioner")]
        [StringLength(20, ErrorMessage = "Length must be under 20 chars")]
        public string Requisitio { get; set; }
        [Required]
        [DisplayName("Admin")]
        [DataType("Boolean")]
        [DefaultValue(false)]
        public bool is_admin { get; set; }
        [Required]
        [DisplayName("Superuser")]
        [DataType("Boolean")]
        [DefaultValue(false)]
        public bool is_superuser { get; set; }
        [Required]
        [DisplayName("TSSC")]
        [DataType("Boolean")]
        [DefaultValue(false)]
        public bool is_tssc { get; set; }
        [DisplayName("CostCenter")]
        [StringLength(10, ErrorMessage = "Length must be 10 chars or less")]
        public string Cost_Cent { get; set; }
        [DisplayName("InternalOrder")]
        [StringLength(10, ErrorMessage = "Length must be 10 chars or less")]
        public string Int_Order { get; set; }
        [DisplayName("Filter")]
        [StringLength(2000, ErrorMessage = "Length must be 500 chars or less")]
        public string filter { get; set; }
    }

    //public class Papi_UsersDBContext : DbContext
    public partial class PODBContext : DbContext
    {
        public DbSet<Papi_Users> Papi_Users_tbl { get; set; }
    }
}